import React from 'react';
import { Modal } from 'antd';
import { ModalTable, TipBox } from '../../../components';
import { MODAL_DEFAULT_PARAM, MODAL_FORCE_PARAM } from '../config';
import { useUnDoneSubTaskList } from '../../../hooks';
import styles from './index.less';

const CancelNoActionModal = ({ taskId, visible, setVisible }) => (
    // console.log('CancelNoActionModal -> taskId', taskId);
    <Modal
        {...MODAL_DEFAULT_PARAM}
        title="取消"
        wrapClassName={styles.noCancelBtn}
        width={800}
        visible={visible}
        onOk={() => setVisible(false)}
        destroyOnClose
        onCancel={() => setVisible(false)}
        {...MODAL_FORCE_PARAM}
    >
        <TipBox title="无法取消" content="当前任务下存在未完成的子任务，需先将子任务取消！" />
        <ModalTable taskId={taskId} loadData={useUnDoneSubTaskList} type="cancel" title="子任务清单" />
    </Modal>
);
export default CancelNoActionModal;
